<?php

namespace app\index\model;

use think\Db;
use think\Exception;
use think\Model;

class Register extends Model
{
    public function index($data)
    {
        try{
            $res = Db::name('user')->insertGetId($data);
            return $res;
        } catch (Exception $e) {
            return false;
        }
    }

    public function tel($tel)
    {
        $res  = Db::name('user')
            ->field('tel')
            ->where($tel)
            ->find();
        return $res;
    }
}
